'''
Created on Nov 29, 2010

@author: philip
'''
from models import Community
from django.core.exceptions import ObjectDoesNotExist

class CommunityService:
    def __init__(self):
        pass
    
    def getCommunity(self,name):
        try:
            urlName = Community.name2UrlName(name)
            return Community.objects.get(urlName=urlName)
        except ObjectDoesNotExist:
            return None